
from django.db.models import CharField,IntegerField,ForeignKey,DO_NOTHING,TextField,DateField,PROTECT
from apps.vadmin.op_drf.models import CoreModel


"""
消耗品是不需归还的
"""
class ConsumableRecords(CoreModel):
    consumable = ForeignKey(to="assets.Consumables",null=True,db_constraint=False,on_delete=PROTECT,verbose_name="借出消耗品Id")
    assigned_to = ForeignKey(to="permission.UserProfile",null=True,db_constraint=False,on_delete=PROTECT,related_name='consumable_assigned_to',verbose_name="借用人")
    qty = IntegerField(null=True,verbose_name="借出数量")
    notes = TextField(null=True,verbose_name="备注")


    class Meta:
        verbose_name = '消耗品借用记录表'
        verbose_name_plural = verbose_name
